import {NgModule} from '@angular/core';
import {Routes, RouterModule} from "@angular/router";
import {PaymentComponent} from "@payment/payment.component";
import {AuthGuardService} from "@shared/service/auth-guard/auth-guard.service";
import {PaymentMainComponent} from "@payment/payment-main/payment-main.component";
import {PaymentResultComponent} from "@payment/payment-result/payment-result.component";

const routes: Routes = [
  {
    path: '',
    component: PaymentComponent,
    canActivateChild: [AuthGuardService],
    children: [
      {
        path: '',
        redirectTo: 'pay'
      },
      {
        path: 'pay',
        component: PaymentMainComponent
      },
      {
        path: 'result',
        component: PaymentResultComponent
      }
    ]
  }
];

@NgModule({
  imports: [
    RouterModule.forChild(routes)
  ],
  exports: [RouterModule]
})

export class PaymentRoutingModule {
}
